package demo1;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-08
 * Time: 10:33
 */
public class demo5 {
    public static void main(String[] args) throws IOException {
        File file1 = new File("D:/tex1.txt");
        File file2 = new File("D:/tex2.txt");
        file1.createNewFile();
        file1.renameTo(file2);
        System.out.println(file1.exists());
        System.out.println(file2.exists());
    }


}
